<script>
import * as dd from 'dingtalk-jsapi'
import { getAction } from '@/utils/api.js'
export default {
  data() {
    return {
      mes: null,
    }
  },
  onLaunch: async function () {
    dd.getAuthCode({
      corpId: 'dingd44c6e17e63c19e335c2f4657eb6378f',
      success: (res) => {
        this.mes = res.code
      },
    })
  },
  onShow: function () {
    console.log('App Show')
  },
  onHide: function () {
    console.log('App Hide')
  },
  watch: {
    mes(newValue) {
      getAction('/sysbase/openapi/v2/oauth2/LoginNew', {
        code: newValue,
      }).then((rs) => {
        console.log(rs.result.userInfo)
      })
    },
  },
}
</script>

<style>
/*每个页面公共css */
@import './static/css/main.css';
</style>